//
//  HomeCell2.m
//  Tunnel
//
//  Created by wbb on 2025/6/2.
//

#import "HomeCell2.h"
#import "YXJCVC.h"
#import "JKGJVC.h"
#import "GZGJVC.h"
@implementation HomeCell2

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    [self.stackView1 addTarget:self action:@selector(onClick1)];
    [self.stackView2 addTarget:self action:@selector(onClick2)];
    [self.stackView3 addTarget:self action:@selector(onClick3)];
    [self.stackView4 addTarget:self action:@selector(onClick4)];
    
}
- (void)cellWithData:(id)data {
    [super cellWithData:data];
    if(!data) return;
    NSDictionary *dic = (NSDictionary *)data;
    self.sbzsLab.text = kAppStringFormat(@"%@", dic[@"total"]?:@"0") ;
    self.gjsbLab.text = kAppStringFormat(@"%@", dic[@"alarmNum"]?:@"0");
    self.lxsbLab.text = kAppStringFormat(@"%@", dic[@"offLineNum"]?:@"0");
    self.gzsbLab.text = kAppStringFormat(@"%@", dic[@"faultNum"]?:@"0");
    
}
- (void)onClick1 {
    
    YXJCVC *vc = [[YXJCVC alloc] init];
    [[WDGlobal getCurrentViewController].navigationController pushViewController:vc animated:NO];
    
    
}
- (void)onClick2 {
    YXJCVC *vc = [[YXJCVC alloc] init];
    vc.onOffStatus = @"0";
    [[WDGlobal getCurrentViewController].navigationController pushViewController:vc animated:NO];
}

- (void)onClick3 {
    JKGJVC *vc = [[JKGJVC alloc] init];
    vc.alarmStatus = @"2";
    [[WDGlobal getCurrentViewController].navigationController pushViewController:vc animated:NO];
}
- (void)onClick4 {
    GZGJVC *vc = [[GZGJVC alloc] init];
    [[WDGlobal getCurrentViewController].navigationController pushViewController:vc animated:NO];
}
@end
